package com.tianshuo.feign.main;

import com.tianshuo.feign.client.UserClient;
import feign.Feign;
import feign.Request;
import feign.Retryer;
import feign.gson.GsonEncoder;

/**
 * @ClassName : FeignMain
 * @Description : feign主调用类
 * @Author : tianshuo
 * @Date: 2020-11-01 10:53
 */
public class FeignMain {

    public static void main(String[] args) {

        UserClient service = Feign.builder()
                .encoder(new GsonEncoder())
//                .options(new Request.Options(1000, 3500))
                .retryer(new Retryer.Default(5000, 5000, 3))
                .target(UserClient.class, "http://127.0.0.1:8080");

        System.out.println(service.user());
        System.out.println(service.hp());
    }
}

